from typing import List



class Solution:
    def memLeak(self, memory1: int, memory2: int) -> List[int]:
        now = 1
        while memory1 >= now or memory2 >= now:
            if memory1 >= memory2:
                memory1 -= now
            else:
                memory2 -= now
            now += 1
        return [now, memory1, memory2]


if __name__ == "__main__":
    print(Solution().memLeak(2, 2))  # [3,1,0]
    print(Solution().memLeak(8, 11))  # [6,0,4]
